#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
const int N = 88;
int n;
LL dp[N];
int main()
{
    cin >> n;
    dp[1] = 1, dp[2] = 2, dp[3] = 4;
    for(int i = 4; i <= n; i++)
    {
        dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3];
    }
    
    cout << dp[n] << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
const int N = 88;
int n;
int main()
{
    cin >> n;
    LL a = 1, b = 1, c = 2;
    for(int i = 3; i <= n; i++)
    {
        LL d = a + b + c;
        a = b;
        b = c;
        c = d;
    }
    if(n == 1) cout << b << endl;
    else cout << c << endl;
    return 0;
}
